
from selenium import webdriver
from selenium.webdriver import ActionChains, Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

options = webdriver.ChromeOptions()

options.page_load_strategy = "normal"  # 等待页面完全加载
# 创建浏览器驱动对象
driver = webdriver.Chrome(options=options)
# 隐式等待
driver.implicitly_wait(5)


url = r"E:/QQ缓存/A.html"
driver.get(url)

dom = driver.find_element(By.XPATH, "//input")
wait = WebDriverWait(driver, timeout=5, poll_frequency=0.5)
wait.until(lambda _: dom.is_displayed())


dom.send_keys("666")
select=driver.find_element(By.XPATH, "//select")
select=Select(select)
select.select_by_index(2)
input("按任意键关闭")
# # 关闭驱动对象
driver.close()
driver.quit()
print("结束")
